home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / xi18nint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  10.0 KB  |  470 lines

  1. /*
  2.  * $XConsortium: Xi18nint.h,v 1.20 92/07/29 11:58:18 rws Exp $
  3.  */
  4.  
  5. /*
  6.  * Copyright 1990, 1991 by OMRON Corporation
  7.  * Copyright 1991 by the Massachusetts Institute of Technology
  8.  *
  9.  * Permission to use, copy, modify, distribute, and sell this software and its
  10.  * documentation for any purpose is hereby granted without fee, provided that
  11.  * the above copyright notice appear in all copies and that both that
  12.  * copyright notice and this permission notice appear in supporting
  13.  * documentation, and that the names of OMRON and MIT not be used in
  14.  * advertising or publicity pertaining to distribution of the software without
  15.  * specific, written prior permission.  OMRON and MIT make no representations
  16.  * about the suitability of this software for any purpose.  It is provided
  17.  * "as is" without express or implied warranty.
  18.  *
  19.  * OMRON AND MIT DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  20.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  21.  * EVENT SHALL OMRON OR MIT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  22.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  23.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  24.  * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  25.  * PERFORMANCE OF THIS SOFTWARE. 
  26.  *
  27.  *    Author:    Seiji Kuwari    OMRON Corporation
  28.  *                kuwa@omron.co.jp
  29.  *                kuwa%omron.co.jp@uunet.uu.net
  30.  */                
  31.  
  32. #ifndef    _XI18NINT_H_
  33. #define    _XI18NINT_H_
  34.  
  35. #include "Xlocaleint.h"
  36.  
  37. /* we should create a data part, but it would affect too much existing code */
  38. typedef struct {
  39.     XFontSetMethods    methods;    /* methods of this font set */
  40.     XFontSetCoreRec    core;        /* core data of this font set */
  41.     Display        *display;    /* display */
  42.     XLocale        xlc;
  43.     int            *ctid;
  44.     XCharStruct        min_bounds;    /* min bounds of all fonts */
  45.     XCharStruct        max_bounds;    /* max bounds of all fonts */
  46.     int            ascent;        /* font set ascent */
  47.     int            descent;    /* font set descent */
  48. } XsiFontSetRec, *XsiFontSet;
  49.  
  50. #ifdef XML
  51. #define XNQueryLanguage        "queryLanguage"
  52. #define XNUsingLanguage        "usingLanguage"
  53. #define XNCurrentLanguage    "currentLanguage"
  54. #define XNChangeLocaleCB    "changeLocaleCB"
  55. #endif
  56.  
  57. typedef struct _ICValues {
  58.     char    *res_name;
  59.     char    *res_class;
  60. #ifdef XML
  61.     char    *using_language;
  62.     char    *current_language;
  63.     int        (*ch_locale_cb)();
  64. #endif
  65. } ICValues;
  66.  
  67. typedef struct _XIMQueue {
  68.     short type;                /* 0: XEvent, 1: String         */
  69.     int length;                /* length of String or XEvent    */
  70.     KeySym keysym;            /* keysym             */
  71.     unsigned int state;            /* state              */
  72.     int buf_max;            /* max of buffer         */
  73.     char *ptr;                /* a pointer of String or XEvent */
  74.     struct _XIMQueue *next;
  75. } XIMQueue;
  76.  
  77. #ifndef    NO_LOCAL_IM
  78.  
  79. #define BITSIZ (sizeof(int) * 8)
  80. #define CHANGE_MAX 256/BITSIZ
  81.  
  82. typedef struct {
  83.     KeySym    keysym;
  84.     unsigned int    state;
  85.     unsigned char    *str;
  86. } XipLocalKeySymTbl;
  87.  
  88. typedef struct _XipLocalNestedKeySym {
  89.     KeySym keysym;
  90.     struct _XipLocalNestedKeySym *next;
  91. } XipLocalNestedKeySym;
  92.  
  93. typedef struct {
  94.     XipLocalKeySymTbl    *fromkey;
  95.     Bool    com;
  96.     union {
  97.     XipLocalKeySymTbl    *tokey;
  98.     int            (*func)();
  99.     } to;
  100. } XipLocalCvtTbl;
  101.  
  102. typedef struct {
  103.     int        cnt;
  104.     XipLocalKeySymTbl    *buf;
  105.     int        buf_cnt;
  106.     int        nmax;
  107.     int        check_flg[CHANGE_MAX];
  108.     Bool    off;
  109.     KeySym    bs;
  110.     XipLocalCvtTbl *tbl, off_tbl;
  111.     XipLocalNestedKeySym *no_filter;
  112. } XipLocalCvt;
  113.  
  114. #endif    /* !NO_LOCAL_IM */
  115.  
  116. /* we should create a data part, but it would affect too much existing code */
  117. typedef struct {
  118.     XICMethods        methods;        /* method list of this IC */
  119.     XICCoreRec        core;            /* core data of this IC */
  120.     struct _XIMQueue    *in, *out, *prev, overflow;
  121.     Bool        (*prototype_filter)();
  122.     XLocale        mb;
  123.     XLocale        wc;
  124.     XID            icid;
  125.     ICValues        values;
  126.     char        *ct_buf;
  127.     wchar_t        *wc_buf;
  128.     int            max_of_ct;
  129.     int            max_of_wc;
  130. #ifdef XML
  131.     XLocale        *mb_temp;
  132.     XLocale        *wc_temp;
  133.     int            xlc_num;
  134. #endif
  135. } XipICRec, *XipIC;
  136.  
  137. #ifndef    NO_LOCAL_IM
  138. typedef struct {
  139.     XICMethods        methods;        /* method list of this IC */
  140.     XICCoreRec        core;            /* core data of this IC */
  141.     struct _XIMQueue    *in, *out, *prev;
  142.     Bool        (*prototype_filter)();
  143.     XLocale        mb;
  144.     XLocale        wc;
  145.     XipLocalCvt        *xcvt;
  146.     ICValues        values;
  147. #ifdef XML
  148.     XLocale        *mb_temp;
  149.     XLocale        *wc_temp;
  150.     XipLocalCvt        **xcvt_temp;
  151.     int            xlc_num;
  152. #endif
  153. } XipLocalICRec, *XipLocalIC;
  154. #endif    /* !NO_LOCAL_IM */
  155.  
  156. #ifdef    XML
  157. #define ICUsingLanguage        28
  158. #define ICCurrentLanguage    29
  159. #define ICChangeLocaleCB    30
  160. #define ICAllMask        0x73ffffff
  161. #else    /* XML */
  162. #define    ICAllMask        0x03ffffff
  163. #endif    /* XML */
  164.  
  165. #define    StatusOffset        11
  166.  
  167.  
  168. /*********************************************************************
  169.  *
  170.  * IM XIM structure;
  171.  *
  172.  *********************************************************************/
  173.  
  174. typedef struct _IMValues {
  175.     XIMStyles    input_styles;
  176.     char    *supported_language;
  177. } IMValues;
  178.  
  179. #define    SEND_BUF_SZ    128
  180. #define    RECV_BUF_SZ    128
  181.  
  182. /* we should create a data part, but it would affect too much existing code */
  183. typedef struct {
  184.     XIMMethods        methods;        /* method list of this IM */
  185.     XIMCoreRec        core;            /* core data of this IM */
  186.     XLocale        xlc;
  187.     int            fd;            /* file discripter of socket */
  188.     XipIC        default_ic;        /* default input context */
  189.     char         *client_data;
  190.     unsigned long    default_mask;
  191.     XIMrmResourceList    resources;
  192.     int            num_resources;
  193.     long        major_version;        /* major version of protocol */
  194.     long        minor_version;        /* minor version of protocol */
  195.     IMValues        values;
  196.     char        send_buf[SEND_BUF_SZ];
  197.     char        recv_buf[RECV_BUF_SZ];
  198.     int            sp;
  199.     int            rp;
  200.     int            rc;
  201. } XipIMRec, *XipIM;
  202.  
  203. #ifndef    NO_LOCAL_IM
  204. typedef struct {
  205.     XIMMethods        methods;        /* method list of this IM */
  206.     XIMCoreRec        core;            /* core data of this IM */
  207.     XLocale        xlc;
  208.     XipLocalCvt        *xcvt;
  209.     XIMrmResourceList    resources;
  210.     int            num_resources;
  211.     IMValues        values;
  212. } XipLocalIMRec, *XipLocalIM;
  213. #endif    /* !NO_LOCAL_IM */
  214.  
  215. #ifdef XML
  216. #define    IMQueryLanguage        1
  217. #endif
  218.  
  219. _XFUNCPROTOBEGIN
  220.  
  221. extern XFontSet _XsiCreateFontSet(
  222. #if NeedFunctionPrototypes
  223.     XLCd, Display*, char*, char**, int, char***, int*
  224. #endif
  225. );
  226.  
  227. extern XIM _XipOpenIM(
  228. #if NeedFunctionPrototypes
  229.     XLCd, Display*, XrmDatabase, char*, char*
  230. #endif
  231. );
  232.  
  233. extern XFontStruct *_XsiQueryFontSetFromId(
  234. #if NeedFunctionPrototypes
  235.     XFontSet, int
  236. #endif
  237. );
  238.  
  239. #ifdef XML
  240. extern void _XsiQueryFontSetWithName(
  241. #if NeedFunctionPrototypes
  242.     XFontSet, char*
  243. #endif
  244. );
  245. #endif
  246.  
  247. extern int _XsimbTextEscapement(
  248. #if NeedFunctionPrototypes
  249.     XFontSet, char*, int
  250. #endif
  251. );
  252.  
  253. extern int _Xsimb8TextEscapement(
  254. #if NeedFunctionPrototypes
  255.     XFontSet, char*, int
  256. #endif
  257. );
  258.  
  259. extern int _XsimbTextExtents(
  260. #if NeedFunctionPrototypes
  261.     XFontSet, char*, int, XRectangle*, XRectangle*
  262. #endif
  263. );
  264.  
  265. extern int _Xsimb8TextExtents(
  266. #if NeedFunctionPrototypes
  267.     XFontSet, char*, int, XRectangle*, XRectangle*
  268. #endif
  269. );
  270.  
  271. extern Status _XsimbTextPerCharExtents(
  272. #if NeedFunctionPrototypes
  273.     XFontSet, char*, int, XRectangle*, XRectangle*, int, int*,
  274.     XRectangle*, XRectangle*
  275. #endif
  276. );
  277.  
  278. extern int _XsimbDrawString(
  279. #if NeedFunctionPrototypes
  280.     Display*, Drawable, XFontSet, GC, int, int, char*, int
  281. #endif
  282. );
  283.  
  284. extern int _Xsimb8DrawString(
  285. #if NeedFunctionPrototypes
  286.     Display*, Drawable, XFontSet, GC, int, int, char*, int
  287. #endif
  288. );
  289.  
  290. extern void _XsimbDrawImageString(
  291. #if NeedFunctionPrototypes
  292.     Display*, Drawable, XFontSet, GC, int, int, char*, int
  293. #endif
  294. );
  295.  
  296. extern void _Xsimb8DrawImageString(
  297. #if NeedFunctionPrototypes
  298.     Display*, Drawable, XFontSet, GC, int, int, char*, int
  299. #endif
  300. );
  301.  
  302. extern int _XsiwcTextEscapement(
  303. #if NeedFunctionPrototypes
  304.     XFontSet, wchar_t*, int
  305. #endif
  306. );
  307.  
  308. extern int _XsiwcTextExtents(
  309. #if NeedFunctionPrototypes
  310.     XFontSet, wchar_t*, int, XRectangle*, XRectangle*
  311. #endif
  312. );
  313.  
  314. extern Status _XsiwcTextPerCharExtents(
  315. #if NeedFunctionPrototypes
  316.     XFontSet, wchar_t*, int, XRectangle*, XRectangle*, int, int*,
  317.     XRectangle*, XRectangle*
  318. #endif
  319. );
  320.  
  321. extern int _XsiwcDrawString(
  322. #if NeedFunctionPrototypes
  323.     Display*, Drawable, XFontSet, GC, int, int, wchar_t*, int
  324. #endif
  325. );
  326.  
  327. extern void _XsiwcDrawImageString(
  328. #if NeedFunctionPrototypes
  329.     Display*, Drawable, XFontSet, GC, int, int, wchar_t*, int
  330. #endif
  331. );
  332.  
  333. extern char *_XipGetIMValues(
  334. #if NeedFunctionPrototypes
  335.     XIM, XIMArg*
  336. #endif
  337. );
  338.  
  339. extern XIC _XipCreateIC(
  340. #if NeedFunctionPrototypes
  341.     XIM, XIMArg*
  342. #endif
  343. );
  344.  
  345. extern void _XipDestroyIC(
  346. #if NeedFunctionPrototypes
  347.     XIC
  348. #endif
  349. );
  350.  
  351. extern void _XipSetICFocus(
  352. #if NeedFunctionPrototypes
  353.     XIC
  354. #endif
  355. );
  356.  
  357. void _XipUnsetICFocus(
  358. #if NeedFunctionPrototypes
  359.     XIC
  360. #endif
  361. );
  362.  
  363. extern char* _XipSetICValues(
  364. #if NeedFunctionPrototypes
  365.     XIC, XIMArg*
  366. #endif
  367. );
  368.  
  369. extern char* _XipGetICValues(
  370. #if NeedFunctionPrototypes
  371.     XIC, XIMArg*
  372. #endif
  373. );
  374.  
  375. extern char* _XipmbResetIC(
  376. #if NeedFunctionPrototypes
  377.     XIC
  378. #endif
  379. );
  380.  
  381. extern wchar_t* _XipwcResetIC(
  382. #if NeedFunctionPrototypes
  383.     XIC
  384. #endif
  385. );
  386.  
  387. extern int _XipmbLookupString(
  388. #if NeedFunctionPrototypes
  389.     XIC, XKeyEvent*, char*, int, KeySym*, Status*
  390. #endif
  391. );
  392.  
  393. extern int _XipwcLookupString(
  394. #if NeedFunctionPrototypes
  395.     XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
  396. #endif
  397. );
  398.  
  399. extern unsigned long _XipReadRdb(
  400. #if NeedFunctionPrototypes
  401.     Display*, XipIC, unsigned long, XrmDatabase, char*, char*
  402. #endif
  403. );
  404.  
  405. #ifndef    NO_LOCAL_IM
  406. extern XIM _XipLocalOpenIM(
  407. #if NeedFunctionPrototypes
  408.     XLCd, Display*, XrmDatabase, char*, char*
  409. #endif
  410. );
  411.  
  412. extern char *_XipLocalGetIMValues(
  413. #if NeedFunctionPrototypes
  414.     XIM, XIMArg*
  415. #endif
  416. );
  417.  
  418. extern XIC _XipLocalCreateIC(
  419. #if NeedFunctionPrototypes
  420.     XIM, XIMArg*
  421. #endif
  422. );
  423.  
  424. extern void _XipLocalDestroyIC(
  425. #if NeedFunctionPrototypes
  426.     XIC
  427. #endif
  428. );
  429.  
  430. extern void _XipLocalSetICFocus(
  431. #if NeedFunctionPrototypes
  432.     XIC
  433. #endif
  434. );
  435.  
  436. void _XipLocalUnsetICFocus(
  437. #if NeedFunctionPrototypes
  438.     XIC
  439. #endif
  440. );
  441.  
  442. extern char* _XipLocalSetICValues(
  443. #if NeedFunctionPrototypes
  444.     XIC, XIMArg*
  445. #endif
  446. );
  447.  
  448. extern char* _XipLocalGetICValues(
  449. #if NeedFunctionPrototypes
  450.     XIC, XIMArg*
  451. #endif
  452. );
  453.  
  454. extern char* _XipLocalmbResetIC(
  455. #if NeedFunctionPrototypes
  456.     XIC
  457. #endif
  458. );
  459.  
  460. extern wchar_t* _XipLocalwcResetIC(
  461. #if NeedFunctionPrototypes
  462.     XIC
  463. #endif
  464. );
  465. #endif    /* !NO_LOCAL_IM */
  466.  
  467. _XFUNCPROTOEND
  468.  
  469. #endif    /* _XI18NINT_H_ */
  470.